package com.zhehekeji.opsys.api.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @ClassName TSigninRecord
 * @Description TODO
 * @author chenweiliu chenwei.liu@163.com
 * @date 2016-7-12   下午3:15:26
 */
@Entity
@Table(name="t_signin_record")
public class TSigninRecord implements java.io.Serializable {

	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = -991754480926281639L;
	private Long id;
	private String userId;
	private Date signinTime;
	private String randomStr;
	private String productCode;
	private String productName;
	private Integer goldNum;
	private TSignin tsignin;
	private Long cpCode;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID",length=20,nullable=false,unique=true)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="USER_ID",length=64,nullable=true)
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	@Column(name="RANDOM_STR",length=50,nullable=true)
	public String getRandomStr() {
		return randomStr;
	}
	public void setRandomStr(String randomStr) {
		this.randomStr = randomStr;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="SIGNIN_TIME")
	public Date getSigninTime() {
		return signinTime;
	}
	public void setSigninTime(Date signinTime) {
		this.signinTime = signinTime;
	}
	@Column(name="PRODUCT_CODE",length=64,nullable=true)
	public String getProductCode() {
		return productCode;
	}
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}
	@Column(name="PRODUCT_NAME",length=128,nullable=true)
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}
	@Column(name="GOLD_NUM",length=128,nullable=true)
	public Integer getGoldNum() {
		return goldNum;
	}
	public void setGoldNum(Integer goldNum) {
		this.goldNum = goldNum;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="SIGNIN_ID")
	public TSignin getTsignin() {
		return tsignin;
	}
	public void setTsignin(TSignin tsignin) {
		this.tsignin = tsignin;
	}
	@Column(name="CP_CODE",length=20,nullable=true)
	public Long getCpCode() {
		return cpCode;
	}
	public void setCpCode(Long cpCode) {
		this.cpCode = cpCode;
	}
}

